package com.ctsi.framework.common.exception;

import com.ctsi.framework.common.constant.ResponseCodeEnum;

/**
 * @author zhangjw
 */
@Deprecated
public class BaseException extends RuntimeException {

    private static final long serialVersionUID = 4160303191929099502L;

    /**
     * 错误代码
     */
    protected String code;

    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    public BaseException(int String, String message) {
        super(message);
        this.code = code;
    }

    public BaseException(String code, String msgFormat, Object... args) {
        super(String.format(msgFormat, args));
        this.code = code;
    }

    public BaseException(ResponseCodeEnum code){
        super(code.msg());
        this.code = code.code();
    }

    public BaseException(ResponseCodeEnum code,Throwable cause){
        super(code.msg(),cause);
        this.code = code.code();
    }

    public BaseException(ResponseCodeEnum code, Object... args) {
        super(String.format(code.msg(), args));
        this.code = code.code();
    }

    public String getCode() {
        return code;
    }
}
